package cn.liontalk.AbstractFactory.pattern1;

public class CarFactory  {

    public static Car createCar(String name){
        Car car = null;
        if("audi".equals(name)){
            car = new Audi();
        }else if("benz".equals(name)){
            car = new Benz();
        }else if("tesla".equals(name)){
            car = new Tesla();
        }
        return car;
    }
}
